<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>御物联设备运行总览 - 登录</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }

        .login-container {
            background: white;
            border-radius: 20px;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
            width: 100%;
            max-width: 400px;
            padding: 40px 30px;
            position: relative;
        }

        .theme-toggle {
            position: absolute;
            top: 20px;
            right: 20px;
            width: 50px;
            height: 25px;
            background: #e0e0e0;
            border-radius: 25px;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .theme-toggle.active {
            background: #4CAF50;
        }

        .theme-toggle::before {
            content: '';
            position: absolute;
            top: 2px;
            left: 2px;
            width: 21px;
            height: 21px;
            background: white;
            border-radius: 50%;
            transition: all 0.3s ease;
        }

        .theme-toggle.active::before {
            transform: translateX(25px);
        }

        .logo {
            text-align: center;
            margin-bottom: 30px;
        }

        .logo-icon {
            width: 80px;
            height: 80px;
            background: linear-gradient(45deg, #ff6b6b, #ffa500);
            border-radius: 50%;
            margin: 0 auto 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            overflow: hidden;
        }

        .logo-icon::before {
            content: '';
            position: absolute;
            width: 100%;
            height: 100%;
            background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
            animation: rotate 3s linear infinite;
        }

        @keyframes rotate {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .logo-icon::after {
            content: '御';
            color: white;
            font-size: 24px;
            font-weight: bold;
            z-index: 1;
        }

        .title {
            font-size: 24px;
            font-weight: 600;
            color: #333;
            text-align: center;
            margin-bottom: 30px;
        }

        .form-group {
            margin-bottom: 20px;
            position: relative;
        }

        .input-field {
            width: 100%;
            height: 50px;
            border: 2px solid #e0e0e0;
            border-radius: 25px;
            padding: 0 20px 0 50px;
            font-size: 16px;
            transition: all 0.3s ease;
            background: #f8f9fa;
        }

        .input-field:focus {
            outline: none;
            border-color: #667eea;
            background: white;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }

        .input-icon {
            position: absolute;
            left: 18px;
            top: 50%;
            transform: translateY(-50%);
            color: #999;
            font-size: 18px;
        }

        .checkbox-group {
            display: flex;
            align-items: center;
            margin-bottom: 30px;
            font-size: 14px;
            color: #666;
        }

        .checkbox {
            width: 18px;
            height: 18px;
            margin-right: 8px;
            cursor: pointer;
        }

        .info-icon {
            width: 16px;
            height: 16px;
            background: #667eea;
            color: white;
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            margin-left: 5px;
            cursor: help;
        }

        .login-btn {
            width: 100%;
            height: 50px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            border-radius: 25px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
        }

        .login-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
        }

        .login-btn:active {
            transform: translateY(0);
        }

        .menu-icon {
            position: absolute;
            bottom: 20px;
            right: 20px;
            width: 30px;
            height: 30px;
            cursor: pointer;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }

        .menu-icon span {
            width: 20px;
            height: 2px;
            background: #999;
            margin: 2px 0;
            transition: all 0.3s ease;
        }

        /* 暗色主题 */
        body.dark-theme {
            background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
        }

        body.dark-theme .login-container {
            background: #2c3e50;
            color: #ecf0f1;
        }

        body.dark-theme .title {
            color: #ecf0f1;
        }

        body.dark-theme .input-field {
            background: #34495e;
            border-color: #4a5f7a;
            color: #ecf0f1;
        }

        body.dark-theme .input-field:focus {
            border-color: #667eea;
            background: #34495e;
        }

        body.dark-theme .input-icon {
            color: #bdc3c7;
        }

        body.dark-theme .checkbox-group {
            color: #bdc3c7;
        }

        /* 响应式设计 */
        @media (max-width: 480px) {
            .login-container {
                padding: 30px 20px;
                margin: 10px;
            }
            
            .title {
                font-size: 20px;
            }
            
            .logo-icon {
                width: 60px;
                height: 60px;
            }
            
            .logo-icon::after {
                font-size: 20px;
            }
        }
    </style>
</head>
<body>
    <div class="login-container">
        <!-- 主题切换开关 -->
        <div class="theme-toggle" onclick="toggleTheme()"></div>
        
        <!-- Logo -->
        <div class="logo">
            <div class="logo-icon"></div>
            <h1 class="title">御物联设备运行总览</h1>
        </div>
        
        <!-- 登录表单 -->
        <form class="login-form">
            <div class="form-group">
                <div class="input-icon">👤</div>
                <input type="text" class="input-field" placeholder="账号" required>
            </div>
            
            <div class="form-group">
                <div class="input-icon">🔒</div>
                <input type="password" class="input-field" placeholder="密码" required>
            </div>
            
            <div class="checkbox-group">
                <input type="checkbox" class="checkbox" id="remember">
                <label for="remember">3天内免登录</label>
                <div class="info-icon" title="登录后3天内无需重新输入密码">i</div>
            </div>
            
            <button type="submit" class="login-btn">登录</button>
        </form>
        
        <!-- 菜单图标
        <div class="menu-icon" onclick="toggleMenu()">
            <span></span>
            <span></span>
            <span></span>
        </div> -->
    </div>

    <script>
        // 主题切换功能
        function toggleTheme() {
            const body = document.body;
            const themeToggle = document.querySelector('.theme-toggle');
            
            body.classList.toggle('dark-theme');
            themeToggle.classList.toggle('active');
            
            // 保存主题偏好
            const isDark = body.classList.contains('dark-theme');
            localStorage.setItem('theme', isDark ? 'dark' : 'light');
        }

        // 初始化主题
        function initTheme() {
            const savedTheme = localStorage.getItem('theme');
            const body = document.body;
            const themeToggle = document.querySelector('.theme-toggle');
            
            if (savedTheme === 'dark') {
                body.classList.add('dark-theme');
                themeToggle.classList.add('active');
            }
        }

        // 菜单切换功能
        // function toggleMenu() {
        //     alert('菜单功能开发中...');
        // }

        // 登录表单处理
        document.querySelector('.login-form').addEventListener('submit', function(e) {
            e.preventDefault();
            
            const username = this.querySelector('input[type="text"]').value;
            const password = this.querySelector('input[type="password"]').value;
            const remember = this.querySelector('input[type="checkbox"]').checked;
            
            if (username && password) {
                // 模拟登录过程
                const loginBtn = this.querySelector('.login-btn');
                const originalText = loginBtn.textContent;
                
                loginBtn.textContent = '登录中...';
                loginBtn.disabled = true;
                
                setTimeout(() => {
                    // 模拟用户信息并保存
                    const user = {
                        name: username || '演示用户',
                        account: username || 'demo',
                        role: '管理员',
                        phone: '13800001234'
                    };
                    localStorage.setItem('currentUser', JSON.stringify(user));
                    // 登录成功后跳转系统情况页
                    window.location.href = 'system-overview.html';
                }, 800);
            } else {
                alert('请输入账号和密码');
            }
        });

        // 页面加载时初始化主题
        document.addEventListener('DOMContentLoaded', initTheme);
    </script>
</body>
</html>
